<template>
  <div :class="tableClass">
      <div :class="mainTableClass" :style="mainTableStyle">
        <slot name="head"></slot>
        <slot name="body"></slot>
      </div>
  </div>
</template>
<script>
const prefixCls = "vbestui-table";
import { oneOf } from "utils/index";
export default {
  name: "BTable",
  provide() {
    return {
      vbestTable: this,
    };
  },
  data() {
    return {
      prefixCls: prefixCls,
    };
  },
  props: {
    /**隔行变色 */
    stripe: {
      type: Boolean,
      default: false,
    },
    stripeBackgroundColor: {
      type: String,
      default: "",
    },
    /**是否显示分割线 */
    split: {
      type: Boolean,
      default: false,
    },
    /**分割线颜色 */
    splitColor: {
      type: String,
      default: "",
    },
    showBorder: {
      type: Boolean,
      default: false,
    },
    /**list边框颜色 */
    borderColor: {
      type: String,
      default: "",
    },
    warp:{
      type:Boolean,
      default:false
    }
  },
  computed: {
    tableClass() {
      return [`${prefixCls}`];
    },
    mainTableClass() {
      return [
        `${prefixCls + "-container"}`,
        this.split || this.showBorder ? `${this.prefixCls + "-border"}` : "",
      ];
    },
    mainTableStyle() {
      /**是否显示分割线 */
      return {
        borderColor: this.splitColor || this.borderColor,
      };
    },
  },
};
</script>